#include<iostream>
using namespace std;
typedef long long LL;
const int N = 2e5 + 10;
int n, m;
bool prime(int x)
{
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return 0;
	}
	return 1;
}
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n;
		//cout << 1 << " " << n - 2 << " " << 1 << endl;
		n--;
		if ((n + 1) % 2 == 0)cout << n / 2 << " " << n - n / 2 << " " << 1 << endl;
		else {
			int x = 0;
			for (int i = 2; i <= n; i++) {
				if (prime(i) && n % i != 0) {
					x = i;
					break;
				}
			}
			cout << "x==" << x << endl;
			cout << x << " " << n - x << " " << 1 << endl;
		}
	}
	return 0;
}